#{extends 'main.html' /}
#{set title:'Home' /}

<link href="@{'/public/css/main.css'}" rel="stylesheet" type="text/css" />
<link href="@{'/public/css/tables.css'}" rel="stylesheet" type="text/css" />
 
#{form @bookNewRide(newRide.id)}
	<h2>Detailed Information:</h2>
	<br>
	<table>
	  <tr>
	    <td><strong>Name of Driver:</strong></td>
	    <td><a href="@{Profile.showCarInfoForRide(newRide.driver)}">${newRide.driver.username ?: 'guest'}</a></td>
	  </tr>
	  <tr>
	    <td><strong>Start point:</strong></td>
	    <td>${newRide.startPoint?: 'Muenchen'}</td>
	  </tr>
	  <tr>
	    <td><strong>Destination campus:</strong></td>
	    <td>${unis.destinationCampusMap.get(newRide.destinationCampusId)?: 'error'}</td>
	  </tr>
	  <tr>
	    <td width="220px"><strong>Number of seats available:</strong></td>
	    <td>${newRide.numOfSeatsAvailable ?: 'error'}</td>
	  </tr>
	  <tr>
	    <td><strong>Date:</strong></td>
	    <td>${newRide.rideDate?: ''} ${newRide.timeOfArrival?: ''}</td>
	  </tr>
	  <tr>
	    <td><strong>Regularity:</strong></td>
	    <td>${unis.regularityList.get(newRide.regularity) ?: 'error'}</td>
	  </tr>
	  <tr>
	    <td><strong>Comments:</strong></td>
	    <td>${newRide.comments ?: 'No comments'}</td>
	  </tr>
	</table>
	<br>
	<input type="submit" style="width:80px;" name="book" value="Book Ride">      
    <input type="button" style="width:80px;" name="back" value="Back" onClick="javascript:history.back()">
#{/form}

    